<h1>Cartões</h1>

<div class="menubar">
	<%= link_to 'Novo cartão', new_cartao_path %>
</div>

<%= flash_alerts %>

<% if @cartoes.nil? or @cartoes.empty? %>
	<%= bootstrap_alert do %>
		<p>Nenhum cartão cadastrado</p>
	<% end %>
<% end %>

<div class="row-fluid">
	<% if @cartoes.any? %>
		<table class="table table-striped">
			<thead>
				<tr>
					<th>Descrição</th>
					<th>Digitos</th>
					<th></th>
					<th></th>
					<th></th>
				</tr>
			</thead>

			<tbody>
				<% @cartoes.each do |cartao| %>
					<tr>
						<td><%= cartao.descricao %></td>
						<td><%= cartao.digitos %></td>
						<td class="text-center span1"><%= show_link cartao %></td>
						<td class="text-center span1"><%= edit_link cartao %></td>
						<td class="text-center span1"><%= link_to icon_remove, delete_cartao_path(cartao), :class => "btn" %></td>
					</tr>
				<% end %>
			</tbody>
		</table>
	<% end %>
</div>

